package demo.map;

import java.util.Collections;
import java.util.HashMap;
import java.util.Hashtable;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.TreeMap;

public class MyMap {

	public static void main(String[] args) {

		Map<Integer,String> map=new HashMap<Integer,String>();
		map.put(3, "Three"); //key always unique
		map.put(2, "two");
		map.put(null, null);
		map.put(3, "Four");
		map.put(4,null);
		System.out.println(map);


		Map<Integer, String> linkedHashMap=new LinkedHashMap<Integer,String>(16, .80f, true);

		linkedHashMap.put(64, "hello1");
		linkedHashMap.put(2, "hello2");
		linkedHashMap.put(5, "hello");
		linkedHashMap.put(3, "hello3");
		linkedHashMap.put(null, "hello4");
		System.out.println(linkedHashMap);
		
		Map<Integer, String> treeMap=new  TreeMap<Integer,String>();
		 //in tree  map null is not allowed as key. 
		treeMap.put(2, null);
		System.out.println(treeMap);
		
          //Collections.synchronizedCollection();
		
		   Map<String, String>  hashTable=new Hashtable<String, String>();
		   
		   hashTable.put(null, null); //null is not allowed in hashtable and treeMap

	}
}
